Improve channel header TalkBack accessibility#6464
Conversation
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThis pull request improves accessibility in Stream Chat's Compose UI by adding semantic metadata to two components: the ChannelAvatar hides its overflow count badge from screen readers, and the ChannelHeader marks its title as a heading and adds content descriptions for the avatar. ChangesAccessibility Semantics for Chat Components
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
SDK Size Comparison 📏
|
|



AND-1180
Goal
The channel header has three accessibility gaps that prevent TalkBack users from interacting with it:
Columnare clickable withRole.Buttonbut expose no readable name. TalkBack treats them as malformed buttons and skips them during swipe navigation.headingsemantic, so TalkBack heading-navigation can't jump to it.+NCountBadgeand the channel formatter's+N moretext both announce — TalkBack hears the count twice.Implementation
Modifier.semantics(mergeDescendants = true) { contentDescription = avatarLabel }on the clickable, whereavatarLabelcomes fromChatTheme.channelNameFormatter.formatChannelName(channel, currentUser)— the same source the header title uses. TalkBack announces the avatar as"<channel name>, button. Double-tap to <onClickLabel>.".Columnwhen clickable. AddModifier.semantics(mergeDescendants = true) {}after the clickable. The merge folds the title + subtitleTextcontent into the button's label, so TalkBack announces the column as one node.Modifier.semantics { heading() }to the channel-nameText. TalkBack heading-navigation can now jump to the channel name.Modifier.semantics { hideFromAccessibility() }to the+NCountBadgeinsideStackedGroupAvatar. The badge is visual emphasis; the formatter's+N moretext already conveys the count to TalkBack.🎨 UI Changes
None. All changes live in the accessibility tree only.
Testing
Enable TalkBack on a physical device. Run the Compose sample.
"Back"."<channel name>, heading". Heading-navigation jumps to it."<channel name>, button. Double-tap to open conversation info."(the verb comes fromonChannelAvatarClickLabel).+Noverflow badge. Confirm the avatar's announcement includes+N moreonce, not twice.channel.imageset (usesSimpleGroupAvatar, noCountBadge). Avatar still names itself correctly.onHeaderTitleClick+onHeaderTitleClickLabel, TalkBack focuses the titleColumnas one node and announces"<title>. <subtitle>. Button. Double-tap to <label>.".Summary by CodeRabbit